Skip to content

fix: correct sindi n_candidate error message and doc - #2709

Open
biaozy wants to merge 1 commit into
antgroup:mainfrom
biaozy:fix/sindi-n-candidate-error-message
Open

fix: correct sindi n_candidate error message and doc#2709
biaozy wants to merge 1 commit into
antgroup:mainfrom
biaozy:fix/sindi-n-candidate-error-message

Conversation

@biaozy

@biaozy biaozy commented Aug 18, 2026

Copy link
Copy Markdown

fix: correct sindi n_candidate error message and doc

Fixes: #2708

Description

The SINDI::KnnSearch parameter check validates n_candidate against SPARSE_AMPLIFICATION_FACTOR * k (500x), but the error message printed AMPLIFICATION_FACTOR * k (100x). This mismatch misleads users when tuning the parameter.

Additionally, the SINDI documentation stated that n_candidate = 0 defaults to SPARSE_AMPLIFICATION_FACTOR * topk (500x), which does not match the actual implementation. The code uses ef = max(n_candidate, k), so the default candidate heap size is topk.

Changes

  • src/algorithm/sindi/sindi.cpp: use SPARSE_AMPLIFICATION_FACTOR in the error message.
  • docs/docs/en/src/indexes/sindi.md: correct the description of n_candidate default behavior and allowed range.
  • docs/docs/zh/src/indexes/sindi.md: sync the Chinese documentation.
  • tests/test_sindi.cpp: add a test verifying that the error message matches the actual limit (500 * k).

Testing

  • Built with make release in the vsaglib/vsag:ubuntu Docker development image.
  • Ran the new SINDI test: the boundary case n_candidate = 500 * k succeeds, and n_candidate = 500 * k + 1 fails with a message containing "should be less than 500 * k".
  • Ran make fmt and make lint; no new issues introduced.

Checklist

  • Code follows the project coding style.
  • Added/updated unit tests for the bug fix.
  • Updated both English and Chinese documentation.
  • Verified the build and tests pass.

Signed-off-by: biao.zhoub <biao.zhoub@alibaba-inc.com>
@vsag-bot

Copy link
Copy Markdown
Collaborator

/label status/waiting-for-review
/waiting-on reviewer
/request-review @jiaweizone
/request-review @wxyucs
/request-review @inabao
/request-review @LHT129

@mergify

mergify Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 2 of 2 protections blocking · waiting on 🙋 you

Protection Waiting on
🔴 Require kind label 🙋 you
🔴 Require version label 🙋 you

🔴 Require kind label

Waiting for

  • label~=^kind/
This rule is failing.
  • label~=^kind/

🔴 Require version label

Waiting for

  • label~=^version/
This rule is failing.
  • label~=^version/

@biaozy

biaozy commented Aug 19, 2026

Copy link
Copy Markdown
Author

Hi maintainers, could you please add kind/bug and version/1.0 labels to this PR? The Mergify check is blocked without them. Thanks!

@wxyucs

wxyucs commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

/kind bug
/version 1.1
/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug](sindi): n_candidate error message uses wrong amplification factor

3 participants